import Layout from "@/layout/index.vue";
import store from "@/store";
import Page404 from "@/views/page-404.vue";
import type { RouteItem } from "./types";

/**
 * 动态路由
 */
export const dynamicRouters: Array<RouteItem> = [
  {
    path: "/",
    name: "index",
    redirect: "/home",
    component: Layout,
    meta: { title: "工作台", icon: "tdesign:home" },
    children: [
      {
        path: "/home",
        meta: { title: "首页展示", icon: "tdesign:dashboard-1" },
        component: () => import("../views/example/home.vue")
      },
    ]
  },
  {
    path: "/point",
    name: "point",
    component: Layout,
    meta: { title: "积分提现", icon: "tdesign:money" },
    redirect: "/point/review",
    children: [
      {
        path: "/point/review",
        name: "point-review",
        meta: { title: "提现审核", keepAlive: true },
        component: () => import("../views/withdrawalBackend-views/withdrawalReview.vue"),
      },
      {
        path: "/point/stats",
        name: "point-stats",
        meta: { title: "提现统计" },
        component: () => import("../views/withdrawalBackend-views/withdrawalStatistics.vue")
      }
    ]
  },
  {
    path: "/points",
    name: "points",
    component: Layout,
    meta: { title: "积分管理", icon: "tdesign:leaderboard" },
    redirect: "/points/settings",
    children: [
      {
        path: "/points/settings",
        name: "points-setting",
        meta: { title: "积分设置", keepAlive: true },
        component: () => import("../views/pointBackend-views/pointsSetting.vue"),
      },
      {
        path: "/points/records",
        name: "points-records",
        meta: { title: "积分记录" },
        component: () => import("../views/pointBackend-views/pointRecord.vue")
      }
    ]
  },
  {
    path: "/credit",
    name: "credit",
    component: Layout,
    meta: { title: "信用分管理", icon: "tdesign:play-demo" },
    redirect: "/credit/settings",
    children: [
      {
        path: "/credit/review",
        name: "credit-review",
        meta: { title: "信用分审核", keepAlive: true },
        component: () => import("../views/creditScoreBackend-views/creditScoreReview.vue"),
      },
      {
        path: "/credit/settings",
        name: "credit-score-settings",
        meta: { title: "信用分设置" },
        component: () => import("../views/creditScoreBackend-views/creditScoreSettings.vue")
      }
    ]
  },
  {
    path: "/message",
    name: "message",
    meta: { title: "消息通知管理"},
    component: Layout,
    redirect: "/message/index",
    children: [
      {
        path: "/message/index",
        name: "message-index",
        meta: { title: "消息通知", icon: "tdesign:notification"},
        component: () => import("../views/msg.vue"),
      }
    ]
  },
  {
    path: "/setting",
    name: "setting",
    meta: { title: "设置" },
    component: Layout,
    redirect: "/setting/index",
    children: [
      {
        path: "/setting/index",
        name: "setting-index",
        meta: { title: "设置", icon: "tdesign:setting-1" },
        component: () => import("../views/setting.vue")
      }
    ]
  }
];
